<template>
	<h1 class="messageCenter">消息中心</h1>
	<h2 class="Platform">平台消息</h2>
	<div class="scrollContainer">
		<div class="card" v-for="(item, index) in PlatformMessages" :key="index">
			<h2 class="cardTitle">{{ item.title }}</h2>
			<image class="image" :src="item.MessageImages"></image>
			<p class="cardContent">{{ item.content }}</p>
		</div>
	</div>

	<h2 class="Platform">聊天消息</h2>
	<div>
		<div class="card" v-for="(item, index) in chatMessage" :key="index">
			<h2 class="cardTitle">{{ item.title }}</h2>
			<image class="image" :src="item.MessageImages"></image>
			<p class="cardContent">{{ item.content }}</p>
		</div>
	</div>

</template>


<script setup>
	import {
		ref
	} from 'vue';
	const PlatformMessages = ref(Array.from({
		length: 20
	}, () => ({
		title: '消息',
		MessageImages: '/static/logo.png',
		content: '消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息...'
	})));

	const chatMessage = ref(
		Array.from({
			length: 50
		}, () => ({
			title: '消息',
			MessageImages: '/static/img/Doctor.jpg',
			content: '消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息...'
		}))
	)
</script>

<style>
	.messageCenter {
		padding-left: 32px;
		padding-top: 18px;
		color: black;
		font-weight: bold;
		font-size: 30px;
	}

	.Platform {
		padding-left: 32px;
		padding-top: 18px;
		font-size: 20px;
		opacity: 80%
	}

	.scrollContainer {
		overflow-y: auto;
		/* 垂直滚动 */
		height: 150px;
	}

	.card {

		border: 1px solid #707070;
		border-radius: 10px;
		margin: 6px auto;
		max-width: 800px;
		height: 40px;
		width: 330px;
	}

	.image {
		height: 35px;
		width: 35px;
		border-radius: 10px;
		margin-top: -25px;
		margin-left: 5px;

	}

	.cardTitle {
		padding-top: 8px;
		padding-left: 48px;
		font-size: 10px;
		font-weight: bold;

	}

	.cardContent {
		padding-left: 48px;
		margin-top: -15px;
		font-size: 6px;
		color: #707070;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		padding-bottom: 8px;
	}
</style>